def count_characters(input_str):
    char_count = {}
    for char in input_str:
        if char.isalnum():
            char_count[char] = char_count.get(char, 0) + 1
    return char_count

input_str = input("请输入一个字符串：")
result = count_characters(input_str)
print(result)
